const express = require("express")

const router = express.Router()
const infoHandle = require("../router_handle/userinfo")
// 1. 导入验证表单数据的中间件
const expressJoi = require('@escook/express-joi')
// 2. 导入需要的验证规则对象
const { userinfo,changePwd } = require('../schema/user')

router.post('/detail',expressJoi(userinfo),infoHandle.detail)
router.post("/updateInfo",expressJoi(userinfo),infoHandle.updateInfo)
router.post("/changePwd",expressJoi(changePwd),infoHandle.changePWD)
router.post("/updateAvatar",infoHandle.updateAvatar)
router.post("/select",infoHandle.selectAll)
router.post("/addUser",infoHandle.addUser)
router.post("/updateState",infoHandle.updateState)

module.exports = router